﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入用户名：");
            string name = Console.ReadLine();
            Console.WriteLine("请输入所在的游戏：");
            string games = Console.ReadLine();
            Console.WriteLine("{0}在{1}消费了99999！特此享有马化腾服务1", name, games);



            Console.WriteLine("请输入第一个数字：");
            double num1 = Double.Parse(Console.ReadLine());
            Console.WriteLine("请输入第二个数字：");
            double num2 = Double.Parse(Console.ReadLine());
            Console.WriteLine("两个数中较大的数字为{0}", Math.Max(num1, num2));
            Console.WriteLine("两个数中较小的数为字{0}", Math.Min(num1, num2));


            Random rd = new Random();
            Console.WriteLine("产生一个100以内的数：{0}", rd.Next(0, 100));
            Console.WriteLine("产生一个0到1之间的浮点数：{0}", rd.NextDouble());
            byte[] b = new byte[5];
            rd.NextBytes(b);
            Console.WriteLine("产生的byte类型的值为：");
            foreach (byte i in b)
            {
                Console.Write(i + " ");
            }
            Console.WriteLine();





            DateTime sj = DateTime.Now;
            Console.WriteLine("当前日期为：{0}", sj);
            Console.WriteLine("当前时本月的第{0}天", sj.Day);
            Console.WriteLine("当前是：{0}", sj.DayOfWeek);
            Console.WriteLine("当前是本年度第{0}天", sj.DayOfYear);
            Console.WriteLine("30 天后的日期是{0}", sj.AddDays(30));




            DateTime dt2 = new DateTime(2019, 6, 1);
            TimeSpan ts = dt2 - sj;
            Console.WriteLine("间隔的天数为{0}天", ts.Days);
        }
    }
}
